import {Component, OnInit} from '@angular/core';
import {AppService} from './app.service';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  public nav: any;

  constructor(private appService: AppService) {}

  getNav() {
    this.appService.getNav().subscribe(res => {
      this.nav = res;
    });
  }

  ngOnInit() {
    this.getNav();
  }
}
